% ! bornoulli-beam element stiffness matrix in local system
clc
clear

syms E Iz L A

a=0.5*L;

k_e_bornoulli_beam_stiffness=E*Iz/(2*a^3)*[3 3*a -3 3*a ;3*a 4*a*a -3*a 2*a*a; -3 -3*a 3 -3*a;3*a 2*a*a -3*a 4*a*a ];
disp('k_e_bornoulli_beam_stiffness:')
simplify(k_e_bornoulli_beam_stiffness)

% todo : 2d truss element stiffness matrix in local system

k_e_2d_truss_stiffness=(E*A/L)*[1 -1; -1 1];

% todo : elem's dof 
frame_2d_stiffness=sym(zeros(6,6));

frame_2d_stiffness([1,4],[1,4])=k_e_2d_truss_stiffness;

frame_2d_stiffness([2,3,5,6],[2,3,5,6])=k_e_bornoulli_beam_stiffness;
disp('frame_2d_stiffness:')
simplify(frame_2d_stiffness)